import React, { Fragment } from 'react';
import { Button, Row, Col } from 'antd';
import router from 'umi/router';
import Result from '@/components/Result';
import styles from '../../components/BatchUpload/style.less';

class Finish extends React.PureComponent {
  render() {
    const { resultInfo, setCurrentstep } = this.props;
    const information = (
      <div className={styles.information} style={{ lineHeight: '32px' }}>
        <Row>
          <Col span={6} className={styles.label}>
            收款人类型：
          </Col>
          <Col span={4}>{resultInfo.payeeTypeName}</Col>
        </Row>
        <Row>
          <Col span={6} className={styles.label}>
            收款人名称：
          </Col>
          <Col span={4}>{resultInfo.payee}</Col>
        </Row>
        <Row>
          <Col span={6} className={styles.label}>
            支付金额（元）：
          </Col>
          <Col span={4}>{resultInfo.paymentAmount}</Col>
        </Row>
      </div>
    );
    const actions = (
      <Fragment>
        <Button type="primary" onClick={() => setCurrentstep(0)}>
          继续操作
        </Button>
        <Button onClick={() => router.goBack()}>完成</Button>
      </Fragment>
    );
    return (
      <Result
        type={resultInfo.errorCount ? null : 'success'}
        title={resultInfo.errorCount ? null : '操作成功'}
        extra={information}
        actions={actions}
        className={styles.result}
      />
    );
  }
}

export default Finish;
